#{extends 'admin.html' /}
#{set title:'Administration : Tous les articles' /}

#{if flash.success}
    <h4 class="alert_success">${flash.success}</h4>
#{/if}

<article class="module width_3_quarter">
    <header><h3 class="tabs_involved">Administration des Articles</h3>
        <ul class="tabs">
            <li><a href="@{Articles.create}">Ajouter un article</a></li>
            <li><a href="@{Admin.index}">Accueil Administration</a></li>
        </ul>
    </header>
    <div class="tab_container">
        <div id="tab1" class="tab_content">
            <table class="tablesorter" cellspacing="0">
                <thead>
                    <tr>
                        <th><!-- actions --></th>
                        <th>Image</th>
                        <th>Titre</th>
                        <th>Auteur</th>
                        <th>Catégorie</th>
                        <th>Date de Création</th>
                    </tr>
                </thead>
                <tbody>
        #{list items:entities, as:'entity'}
                    <tr>
                        <td>
                            <a href="@{Articles.show(entity.id)}"><input type="image" src="@{'/public/images/admin/icn_search.png'}" title="Visualiser"></a>&nbsp;
                            <a href="@{Articles.edit(entity.id)}"><input type="image" src="@{'/public/images/admin/icn_edit.png'}" title="Editer"></a>&nbsp;
                            <a href="@{Articles.delete(entity.id)}" onclick="if (!confirm('Etes vous sur de vouloir supprimer cet article ?')) return false;"><input type="image" src="@{'/public/images/admin/icn_trash.png'}" title="Supprimer"></a>
                        </td>
                        <td><img class="img_list_news" src="@{'/public/images/Articles'}/${entity.images}" alt="img ${entity.id}"/></td>
                        <td>${entity.formatTitle(70)}</td>
                        <td>${entity.user}</td>
                        <td>${entity.category}</td>
                        <td>${entity?.created.format()}</td> 
                    </tr>
	#{/list}
                </tbody>
            </table>
        </div>
    </div>
</article>